<extend name="Base/jssdk_common" />
<block name="html">
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>意见反馈</title>
    <link rel="stylesheet" href="__FUI__/css/frozen.css">
	<style type="text/css">
		.feedback-form{
			margin-top: 10px;
		}
		.ui-form-textarea.ui-form-item{
			height: auto;
		}
		.ui-form-textarea.ui-form-item textarea{
			padding: 15px 0;
		}
		input[type='text']{
			height: 44px;
		}
	</style>
</head>

<body ontouchstart="">

	<header class="ui-header ui-header-stable ui-border-b">
	    <i class="ui-icon-return"></i><h1>意见反馈</h1>
	</header>


	<section class="ui-container feedback-form">
		<div class="ui-form ui-border-t">
		    <form method="post">
		        <div class="ui-form-textarea ui-form-item ui-form-item-pure ui-border-b">
		            <textarea name="content" id="content" rows="7" placeholder="反馈内容" verify-type="isnull" verify-name="反馈内容"></textarea>
		        </div>

		        <if condition="$need_nickname">
                <div class="ui-form-item ui-form-item-pure ui-border-b">
                    <input type="text" placeholder="您的姓名" name="nickname" id="nickname" value="{$user.nickname}" verify-type="isnull" verify-name="姓名">
                    <a href="#" class="ui-icon-close"></a>
                </div>
            	</if>

		        <if condition="$need_mobile">
		        <div class="ui-form-item ui-form-item-pure ui-border-b">
                    <input type="text" placeholder="QQ号/手机号/邮箱" name="mobile" id="mobile" value="{$user.mobile}" verify-type="isnull" verify-name="联系方式">
                    <a href="#" class="ui-icon-close"></a>
                </div>
                </if>

		        <div class="ui-btn-wrap">
				    <a class="ui-btn-lg ui-btn-primary" id="submit">
				        提交
				    </a>
				</div>
		    </form>
		</div>
	</section>





	<script type="text/javascript">

		$(".ui-icon-return").tap(function(){
			closePage();			// 关闭页面
		})
		
		// 表单提交事件
		$("#submit").tap(function(){

			if (!verify()) {	// 数据有效性验证
				return false;
			}
			
			var content = $("#content");
			var nickname = $("#nickname");
			var mobile = $("#mobile");

			var url = "{:U('suggest','','')}";
			var data = {
				content : content.val(),
				nickname : nickname.val(),
				mobile : mobile.val()
			};

			ajax(url,data,successFunc,errorFunc);
		    
		    return false;
		});

		/**
		 * 提交反馈内容成功后处理函数
		 * @author 艾逗笔<765532665@qq.com>
		 */
		function successFunc(data) {
			alert(data.info);
			closePage();
		}

		/**
		 * 提交反馈内容失败时处理函数
		 * @author 艾逗笔<765532665@qq.com>
		 */
		function errorFunc(data) {
			alert(data.info);
		}
	</script>

</body>

</html>
</block>